import * as types from './types'
import { getService } from '../service'
const server = getService()
export default {
  [types.INDEXTAP] ({ commit }, newIndex) {
    return Promise.resolve(commit(types.INDEXTAP, newIndex))
  },
  [types.INDEXCOM] ({ commit }, newIndex) {
    return Promise.resolve(commit(types.INDEXCOM, newIndex))
  },
  [types.ALLFORMS] ({commit}, newForm) {
    return Promise.resolve(commit(types.ALLFORMS, newForm))
  },
  getAllBean ({commit}, payload) {
    return server.getAllBean(payload.compId, payload.userToken)
  },
  fetchTmpls ({ commit }, payload) {
    return server.fetchTmpls(payload.queryName, payload.userToken)
  },
  fetchComps ({commit}, payload) {
    return server.fetchComps(payload.desCode, payload.userToken)
  },
  fetchComFields ({commit}, payload) {
    return server.fetchComFields(payload.beanname, payload.userToken)
  },
  saveTotle ({commit}, conf) {
    return server.saveTotle(conf)
  }
}
